package com.bwie.controller;

import com.bwie.common.pojo.dto.HouseDto;
import com.bwie.common.result.Result;
import com.bwie.service.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class HouseController {
    @Autowired
    private HouseService houseService;

    /**
     * 列表
     * @param houseDto
     * @return
     */
    @PostMapping("getHouseList")
    public Result getHouseList(@RequestBody HouseDto houseDto){
        return houseService.getHouseList(houseDto);
    }

    /**
     * 根据房屋信息回显
     */
    @GetMapping("getHouseByHouseId")
    public Result getHouseByHouseId(@RequestParam("houseId") Integer houseId){
        return houseService.getHouseByHouseId(houseId);
    }
    /**
     * 预约
     */
    @PostMapping("houseBooking")
    public Result houseBooking(@RequestBody HouseDto houseDto){
        return houseService.houseBooking(houseDto);
    }
    /**
     * 插用户银行卡信息
     */
    @GetMapping("ByUserIdSelectCardMsg")
    public Result ByUserIdSelectCardMsg(){
        return houseService.ByUserIdSelectCardMsg();
    }
    /**
     * 购买
     */
    @PostMapping("buyHouse")
    public Result buyHouse(@RequestBody HouseDto houseDto){
        return houseService.buyHouse(houseDto);
    }
}
